/**
 * @author     Gabor Greif <ggreif@gmail.com>
 * @copyright  2009-2010 Gabor Greif
 * @license    http://www.opensource.org/licenses/mit-license.php  MIT License
 * @version    Release: 0.0
 */

#ifndef micker_CSET_hpp
#define micker_CSET_hpp

#include "cValue.hpp"
#include "CommandMap.hpp"

#include <iostream> // FIXME: not really needed

namespace micker {

struct Set : Comm<CommandMap&>
{
    Set(CommandMap& cm)
    : Comm<CommandMap&>(ArgumentsMismatch<2>::proc<Env, proc>, cm)
    {}

    static std::string proc(Pref env, const std::string& command, const std::string& val)
    {
        std::cout << "defining nullary command <" << command << "> with value <" << val << ">\n";
        env.insert(command, Value(val));
        return val;
    }
};

} // namespace micker

#endif // micker_CSET_hpp
